home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
rexx
/
arexx
/
speak2.lzh
/
speak.doc
next >
Wrap
Text File
|
1990-03-08
|
3KB
|
113 lines
Here's a simple ARexx to Narrator translator.
Completely public domain, written by Rick Morris, Victoria AmUser's group.
No warranties, etc. Use at your own risk. Pass it around anywhere you
wish.
Based on the library example RXEXAMPLE given on the ARexx distribution
disk, which is (c) Bill Hawes.
It is called translib.library, and MUST be moved to your libs: directory.
Use the ARexx statement
call addlib('translib.library',0,-30,0)
to add it into the system list.
It contains 2 new functions, XLATE() and SPEAK().
XLATE()
Translates the given string into phoenemes. A maximum of 512 characters
will be generated. A non-zero value in the special variable RESULT
indicates an error occurred. If RESULT is ~= 0, then its absolute value is
the offset (in characters) from the beginning of the input string where the
error occurred. Note the only error that will occur is buffer overflow.
See the autodocs on the Translator.device for more info.
Example:
temp = xlate(hello)
say temp ========> /HEH4LOW
SPEAK()
Uses the narator device to talk. All of the options below are adjustable.
See the table below for defaults, and maxium and minimum values. Error
checking is done on these.
OPTIONS:
SPEAK(STRING,RATE,MODE,PITCH,SEX,VOLUME,SAMPFREQ)
All of these are optional, except the STRING argument which MUST be a valid
phoeneme string.
len = SPEAK("/HEH4LOW",200,1,90,1,32,15000)
------------------------------------^ sample frequency, a bit slow (wierd)
---------------------------------^ volume, half
-------------------------------^ sex, female
----------------------------^ pitch, a bit low
--------------------------^ mode, robotic
----------------------^ rate, a bit fast
------------^ the string
Errors are checked for in this function (mostly by the narrator.device) and
can be detected by the routine returning other that 512 (the length of the
internal buffer). The number returned is the number of characters of
STRING that were succesfully spoken and the global variable RESULT contains
an error message. Try it out, you'll get the idea.
NOTE: If you CALL speak(), as in CALL SPEAK(STRING), then the variable
RESULT will contain the number of characters spoken, and NOT the error
string. This is the way ARexx works..... the CALL instruction sets the
variable RESULT itself, after I set it from within the library.
Here are a list of defaults, and minimum and maximum values.
DEFAULTS
Option Value
Pitch 110
Rate 150
Natural F0 Contour 0
Sex (Male) 0
Volume (FULL) 64
Sampling Frequency 22200
PARAMETER BOUNDS
Minimum Speaking Rate 40
Maximum Speaking Rate 400
Mode Natural 0
Mode Robotic 1
Minimum Pitch 65
Maximum Pitch 320
Sex Male 0
Sex Female 1
Minimum Volume 0
Maximum Volume 64
Minimum Sampling Frequency 5000
Maximum Sampling Frequency 28000
Bug reports to:
Rick Morris
5051 Benton Court
Victoria, B.C.
658-2900
AmUser's Place ID Rick